<?php
namespace app\admin\controller;
use think\Db;
class Update extends Base{
    //升级更新
    public function update(){
        if(request()->isGet()){
            $system=Db::name('system')->where('id',1)->find();
            $this->assign('system',$system);
            return $this->fetch();
        }elseif(request()->isPost()){
            //wdcmenterprise_single
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_single`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`title` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`des` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`img` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`detail` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`state` tinyint(1) NOT NULL,`time` int(10) NOT NULL,`uptime` int(10) NOT NULL,`seotitle` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`seokey` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`seodes` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,PRIMARY KEY (`id`))ENGINE=MyISAM AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;");
            //wdcmenterprise_appointment
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_appointment`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`uname` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`uphone` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`uemail` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`uaddress` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`uredio` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`ucheck` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`message` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`state` tinyint(1) NOT NULL DEFAULT 1,`time` int(10) NOT NULL,PRIMARY KEY (`id`))ENGINE=MyISAM AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;");
            //wdcmenterprise_nnews
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_nnews`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`cate_id` int(11) NOT NULL,`sort` int(11) NOT NULL,`intro` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`from` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`img` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`imgs` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`title` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`photo` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`author` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`state` tinyint(1) NOT NULL,`flag` tinyint(1) NOT NULL,`detail` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`view` int(11) NOT NULL,`time` int(10) NOT NULL,`uptime` int(10) NOT NULL,PRIMARY KEY (`id`))ENGINE=MyISAM AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;");
            //wdcmenterprise_nvideo
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_nvideo`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`cate_id` int(11) NOT NULL,`sort` int(11) NOT NULL,`intro` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`from` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`img` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`title` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`video` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`photo` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`author` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`state` tinyint(1) NOT NULL,`flag` tinyint(1) NOT NULL,`view` int(11) NOT NULL,`time` int(10) NOT NULL,`uptime` int(10) NOT NULL,PRIMARY KEY (`id`))ENGINE=MyISAM AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;");
            //wdcmenterprise_ncate
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_ncate`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`type` int(2) NOT NULL COMMENT '1:资讯；2视频',`catename` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`sort` int(11) NOT NULL,`icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`state` tinyint(1) NOT NULL,`time` int(10) NOT NULL,PRIMARY KEY (`id`))ENGINE=MyISAM AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;");
            //wdcmenterprise_nmessage
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_nmessage`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`openid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`message` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`reply` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`time` int(10) NOT NULL,`type` tinyint(1) NOT NULL COMMENT '1:资讯；2:视频',`state` tinyint(1) NOT NULL COMMENT '1:启用；2：停用',`p_id` int(11) NOT NULL,PRIMARY KEY (`id`))ENGINE=MyISAM AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;");
            //wdcmenterprise_nad
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_nad`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`title` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`img` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`state` tinyint(1) NOT NULL,`sort` int(11) NOT NULL,`time` int(10) NOT NULL,`uptime` int(10) NOT NULL,PRIMARY KEY (`id`))ENGINE=MyISAM AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;");
            //wdcmenterprise_nagree
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_nagree`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`openid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`type` tinyint(1) NOT NULL COMMENT '1:资讯；2：视频；3：留言',`time` int(10) NOT NULL,`state` tinyint(1) NOT NULL COMMENT '1:赞；2：取消赞',`p_id` int(11) NOT NULL,PRIMARY KEY (`id`))ENGINE=MyISAM AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;");
            //wdcmenterprise_naboutus
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_naboutus`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`name` varchar(100) NOT NULL,`logo` varchar(255) NOT NULL,`telephone` varchar(16) NOT NULL,`qq` varchar(16) NOT NULL,`record` varchar(100) NOT NULL COMMENT '公司版权文字',`ico` varchar(255) NOT NULL COMMENT '公司版权图标',`miit` varchar(32) NOT NULL COMMENT '工信部备案',`psr` varchar(32) NOT NULL COMMENT '公安备案',`attr1` varchar(32) NOT NULL,`attrimg11` varchar(255) NOT NULL,`attrimg12` varchar(255) NOT NULL,`attr2` varchar(32) NOT NULL,`attrimg21` varchar(255) NOT NULL,`attrimg22` varchar(255) NOT NULL,`attr3` varchar(32) NOT NULL,`attrimg31` varchar(255) NOT NULL,`attrimg32` varchar(255) NOT NULL,`attr4` varchar(32) NOT NULL,`attrimg41` varchar(255) NOT NULL,`attrimg42` varchar(255) NOT NULL,`appid` varchar(32) NOT NULL,`appsecret` varchar(32) NOT NULL,`bdappid` varchar(32) NOT NULL,`bdappkey` varchar(64) NOT NULL,`bdappsecret` varchar(64) NOT NULL,`create_time` int(10) NOT NULL,`update_time` int(10) NOT NULL,PRIMARY KEY (`id`))ENGINE=MyISAM AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=DYNAMIC;");
            //wdcmenterprise_actives
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_actives`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`time` int(10) NOT NULL,PRIMARY KEY (`id`))ENGINE=MyISAM AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=Fixed;");
            //wdcmenterprise_pluginapp
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_pluginapp`(`id` int(11) NOT NULL AUTO_INCREMENT,`title` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`state` tinyint(1) NOT NULL DEFAULT 1,`buy_state` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0:初始；1:已买；2：下单，未支付',PRIMARY KEY (`id`))ENGINE=MyISAM AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=Fixed;");
            //wdcmenterprise_address
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_address`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`openid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`uname` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`uphone` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`uaddress` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`state` tinyint(1) NOT NULL COMMENT '1启用(默认);2:待；3：删',`time` int(10) NOT NULL,`uptime` int(10) NOT NULL,PRIMARY KEY (`id`))ENGINE=MyISAM AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=Fixed;");
            //wdcmenterprise_orders
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_orders`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`openid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`formid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`buynum` int(11) NOT NULL,`p_id` int(11) NOT NULL,`sub` tinyint(1) NOT NULL DEFAULT 1,`parm` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`address_id` int(11) NOT NULL,`price` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`payfee` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`paystate` tinyint(1) NOT NULL COMMENT '1:待付款；2待发货；3待收货；4已完成；5取消订单（取消支付）；6：删除订单；7：售后-退货退款',`paycode` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`backstate` tinyint(1) NOT NULL COMMENT '1:待发货售后；2：待收货售后-仅退款；3：待收货售后-退货退款；',`backtype` tinyint(1) NOT NULL COMMENT '1:仅退款；2：退货退款',`backreason` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`salesbacktate` tinyint(1) NOT NULL COMMENT '1:申请等待中；2：撤销申请；3：同意；4：不同意；5退款成功',`backpayfee` decimal(11, 2) NOT NULL,`backcert` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`express` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`expressnum` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`uexpress` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`uexpressnum` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`expressfee` decimal(7, 2) NOT NULL,`isevaluate` tinyint(1) NOT NULL DEFAULT 2 COMMENT '1:已评价；2未评价',`time` int(10) NOT NULL,`etime` int(10) NOT NULL,`uptime` int(10) NOT NULL,`applytime` int(10) NOT NULL,PRIMARY KEY (`id`))ENGINE=InnoDB AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=Compact;");
            //wdcmenterprise_ordersub
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_ordersub`(`id` int(11) NOT NULL AUTO_INCREMENT,`of_id` int(11) NOT NULL,`cus_id` int(11) NOT NULL,`openid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`formid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`buynum` int(11) NOT NULL,`p_id` int(11) NOT NULL,`parm` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`address_id` int(11) NOT NULL,`price` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`payfee` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`paystate` tinyint(1) NOT NULL COMMENT '1:待付款；2待发货；3待收货；4已完成；5取消订单（取消支付）；6：删除订单；7：售后-退货退款',`backtype` tinyint(1) NOT NULL COMMENT '1:仅退款；2：退货退款',`paycode` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`backstate` tinyint(1) NOT NULL COMMENT '1:待发货售后；2：待收货售后-仅退款；3：待收货售后-退货退款；',`backreason` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`salesbacktate` tinyint(1) NOT NULL COMMENT '1:申请等待中；2：撤销申请；3：同意；4：不同意；5退款成功',`backpayfee` decimal(11, 2) NOT NULL,`backcert` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`express` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`expressnum` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`uexpress` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`uexpressnum` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`expressfee` decimal(7, 2) NOT NULL,`time` int(10) NOT NULL,`etime` int(10) NOT NULL,`uptime` int(10) NOT NULL,`applytime` int(10) NOT NULL,PRIMARY KEY (`id`))ENGINE=InnoDB AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=Compact;");
            //wdcmenterprise_evaluate
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_evaluate`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`p_id` int(11) NOT NULL,`order_id` int(11) NOT NULL,`openid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`star` int(1) NOT NULL,`message` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`img` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`time` int(10) NOT NULL,PRIMARY KEY (`id`))ENGINE=MyISAM AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=Fixed;");
            //wdcmenterprise_shopcate
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_shopcate`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`f_id` int(11) NOT NULL,`icon` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`catename` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`state` tinyint(1) NOT NULL,PRIMARY KEY (`id`))ENGINE=MyISAM AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=Fixed;");
            //wdcmenterprise_shopgoods
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_shopgoods`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`cate_id` int(11) NOT NULL,`title` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`seotitle` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`seokey` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`seodes` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`content` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`img` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`price` decimal(9, 2) NOT NULL,`sales` int(11) NOT NULL,`flag` int(1) NOT NULL,`state` tinyint(1) NOT NULL,`sort` int(11) NOT NULL,`numbers` int(11) NOT NULL,`imgs` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`attrarrs` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`time` int(10) NOT NULL,`uptime` int(10) NOT NULL,PRIMARY KEY (`id`))ENGINE=InnoDB AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=Compact;");
            //wdcmenterprise_goodscollect
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_goodscollect`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`openid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`good_id` int(11) NOT NULL,`state` tinyint(1) NOT NULL COMMENT '1：收藏；2取消收藏',`time` int(10) NOT NULL,PRIMARY KEY (`id`))ENGINE=MyISAM AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=Fixed;");
            //wdcmenterprise_shopbanner
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_shopbanner`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`link_type` tinyint(1) NOT NULL COMMENT '1:产品详情；2：分类',`title` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`img` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`link` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`sort` int(11) NOT NULL,`state` tinyint(1) NOT NULL,`time` int(10) NOT NULL,`uptime` int(10) NOT NULL,PRIMARY KEY (`id`))ENGINE=MyISAM AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=Dynamic;");
            //wdcmenterprise_shopcart
            Db::execute("CREATE TABLE IF NOT EXISTS `wdcmenterprise_shopcart`(`id` int(11) NOT NULL AUTO_INCREMENT,`cus_id` int(11) NOT NULL,`g_id` int(11) NOT NULL COMMENT '商品id',`openid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`parms` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,`buynum` int(7) NOT NULL,`state` tinyint(1) NOT NULL COMMENT '1:加入;2:假删；3：清空(购买了)',`time` int(10) NOT NULL,`uptime` int(10) NOT NULL,PRIMARY KEY (`id`))ENGINE=InnoDB AUTO_INCREMENT = 1 CHARACTER SET=utf8 COLLATE=utf8_general_ci ROW_FORMAT=Compact;");
            //wdcmenterprise_system
            $update_state=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_system' AND column_name = 'update_state'");
            if($update_state==0){
                Db::execute("ALTER TABLE wdcmenterprise_system ADD update_state int(3) NOT NULL;");
            }
            //wdcmenterprise_message
            $state=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_message' AND column_name = 'state'");
            if($state==0){
                Db::execute("ALTER TABLE wdcmenterprise_message ADD state tinyint(1) NOT NULL default 1;");
            }
            //wdcmenterprise_aboutus
            $ttappid=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'ttappid'");
            if($ttappid==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD ttappid varchar(32) NOT NULL;");
            }
            $ttappsecret=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'ttappsecret'");
            if($ttappsecret==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD ttappsecret varchar(32) NOT NULL;");
            }
            $aseotitle=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'seotitle'");
            if($aseotitle==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD seotitle varchar(100) NOT NULL;");
            }
            $aseokey=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'seokey'");
            if($aseokey==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD seokey varchar(100) NOT NULL;");
            }
            $aseodes=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'seodes'");
            if($aseodes==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD seodes text NOT NULL;");
            }
            $mac_id=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'mac_id'");
            if($mac_id==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD mac_id varchar(32) NOT NULL;");
            }
            $apikey=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'apikey'");
            if($apikey==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD apikey varchar(64) NOT NULL;");
            }
            $apiclient_key=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'apiclient_key'");
            if($apiclient_key==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD apiclient_key text NOT NULL;");
            }
            $apiclient_cert=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'apiclient_cert'");
            if($apiclient_cert==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD apiclient_cert text NOT NULL;");
            }
            $shopstate=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'shopstate'");
            if($shopstate==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD shopstate tinyint(1) NOT NULL DEFAULT 2;");
            }
            $shopindextitle=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'shopindextitle'");
            if($shopindextitle==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD shopindextitle varchar(32) NOT NULL DEFAULT '首页';");
            }
            $shopcatetitle=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'shopcatetitle'");
            if($shopcatetitle==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD shopcatetitle varchar(32) NOT NULL DEFAULT '分类';");
            }
            $shopcarttitle=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'shopcarttitle'");
            if($shopcarttitle==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD shopcarttitle varchar(32) NOT NULL DEFAULT '购物车';");
            }
            $shopmytitle=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'shopmytitle'");
            if($shopmytitle==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD shopmytitle varchar(32) NOT NULL DEFAULT '我的';");
            }
            $shopsearchtitle=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'shopsearchtitle'");
            if($shopsearchtitle==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD shopsearchtitle varchar(32) NOT NULL DEFAULT '商品搜索';");
            }
            $shopdetailtitle=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'shopdetailtitle'");
            if($shopdetailtitle==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD shopdetailtitle varchar(32) NOT NULL DEFAULT '商品详情';");
            }
            $shopmyordertitle=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'shopmyordertitle'");
            if($shopmyordertitle==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD shopmyordertitle varchar(32) NOT NULL DEFAULT '我的订单';");
            }
            $shopcollecttitle=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'shopcollecttitle'");
            if($shopcollecttitle==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD shopcollecttitle varchar(32) NOT NULL DEFAULT '我的收藏';");
            }
            $shopevaluatetitle=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'shopevaluatetitle'");
            if($shopevaluatetitle==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD shopevaluatetitle varchar(32) NOT NULL DEFAULT '我的评价';");
            }
            $shopmyaddresstitle=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'shopmyaddresstitle'");
            if($shopmyaddresstitle==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD shopmyaddresstitle varchar(32) NOT NULL DEFAULT '收货地址';");
            }
            $shopaddaddresstitle=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'shopaddaddresstitle'");
            if($shopaddaddresstitle==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD shopaddaddresstitle varchar(32) NOT NULL DEFAULT '添加地址';");
            }
            $shopeditaddresstitle=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_aboutus' AND column_name = 'shopeditaddresstitle'");
            if($shopeditaddresstitle==0){
                Db::execute("ALTER TABLE wdcmenterprise_aboutus ADD shopeditaddresstitle varchar(32) NOT NULL DEFAULT '编辑地址';");
            }
            //wdcmenterprise_taboutus
            $attr1=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_taboutus' AND column_name = 'attr1'");
            if($attr1==0){
                Db::execute("ALTER TABLE wdcmenterprise_taboutus ADD attr1 varchar(32) NOT NULL;");
            }
            $sattr1=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_taboutus' AND column_name = 'sattr1'");
            if($sattr1==0){
                Db::execute("ALTER TABLE wdcmenterprise_taboutus ADD sattr1 varchar(64) NOT NULL;");
            }
            $attrimg1=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_taboutus' AND column_name = 'attrimg1'");
            if($attrimg1==0){
                Db::execute("ALTER TABLE wdcmenterprise_taboutus ADD attrimg1 varchar(255) NOT NULL;");
            }
            $attr2=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_taboutus' AND column_name = 'attr2'");
            if($attr2==0){
                Db::execute("ALTER TABLE wdcmenterprise_taboutus ADD attr2 varchar(32) NOT NULL;");
            }
            $sattr2=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_taboutus' AND column_name = 'sattr2'");
            if($sattr2==0){
                Db::execute("ALTER TABLE wdcmenterprise_taboutus ADD sattr2 varchar(64) NOT NULL;");
            }
            $attrimg2=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_taboutus' AND column_name = 'attrimg2'");
            if($attrimg2==0){
                Db::execute("ALTER TABLE wdcmenterprise_taboutus ADD attrimg2 varchar(255) NOT NULL;");
            }
            $attr3=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_taboutus' AND column_name = 'attr3'");
            if($attr3==0){
                Db::execute("ALTER TABLE wdcmenterprise_taboutus ADD attr3 varchar(32) NOT NULL;");
            }
            $sattr3=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_taboutus' AND column_name = 'sattr3'");
            if($sattr3==0){
                Db::execute("ALTER TABLE wdcmenterprise_taboutus ADD sattr3 varchar(64) NOT NULL;");
            }
            $attrimg3=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_taboutus' AND column_name = 'attrimg3'");
            if($attrimg3==0){
                Db::execute("ALTER TABLE wdcmenterprise_taboutus ADD attrimg3 varchar(255) NOT NULL;");
            }
            $attr4=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_taboutus' AND column_name = 'attr4'");
            if($attr4==0){
                Db::execute("ALTER TABLE wdcmenterprise_taboutus ADD attr4 varchar(32) NOT NULL;");
            }
            $sattr4=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_taboutus' AND column_name = 'sattr4'");
            if($sattr4==0){
                Db::execute("ALTER TABLE wdcmenterprise_taboutus ADD sattr4 varchar(64) NOT NULL;");
            }
            $attrimg4=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_taboutus' AND column_name = 'attrimg4'");
            if($attrimg4==0){
                Db::execute("ALTER TABLE wdcmenterprise_taboutus ADD attrimg4 varchar(255) NOT NULL;");
            }
            //wdcmenterprise_teacher
            $background=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_teacher' AND column_name = 'background'");
            if($background==0){
                Db::execute("ALTER TABLE wdcmenterprise_teacher ADD background varchar(255) NOT NULL;");
            }
            $tdetail=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_teacher' AND column_name = 'detail'");
            if($tdetail==0){
                Db::execute("ALTER TABLE wdcmenterprise_teacher ADD detail text NOT NULL;");
            }
            //wdcmenterprise_envir
            $eview=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_envir' AND column_name = 'view'");
            if($eview==0){
                Db::execute("ALTER TABLE wdcmenterprise_envir ADD view int(11) NOT NULL;");
            }
            $eimgs=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_envir' AND column_name = 'imgs'");
            if($eimgs==0){
                Db::execute("ALTER TABLE wdcmenterprise_envir ADD imgs varchar(1000) NOT NULL;");
            }
            $edetail=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_envir' AND column_name = 'detail'");
            if($edetail==0){
                Db::execute("ALTER TABLE wdcmenterprise_envir ADD detail text NOT NULL;");
            }
            //wdcmenterprise_collect
            $cstate=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_collect' AND column_name = 'state'");
            if($cstate==0){
                Db::execute("ALTER TABLE wdcmenterprise_collect ADD state tinyint(1) NOT NULL;");
            }
            //wdcmenterprise_customer
            $template=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'template'");
            if($template==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD template int(3) NOT NULL default 1;");
            }
            $template2=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'template2'");
            if($template2==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD template2 int(3) NOT NULL default 1;");
            }
            $template3=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'template3'");
            if($template3==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD template3 int(3) NOT NULL default 1;");
            }
            $themefont=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'themefont'");
            if($themefont==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD themefont tinyint(1) NOT NULL default 1;");
            }
            $themecolor=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'themecolor'");
            if($themecolor==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD themecolor varchar(16) NOT NULL default '#ffffff';");
            }
            $backcolor=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'backcolor'");
            if($backcolor==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD backcolor varchar(16) NOT NULL default '#eeeeee';");
            }
            $bottomcolor=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'bottomcolor'");
            if($bottomcolor==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD bottomcolor varchar(16) NOT NULL default '#019e79';");
            }
            $pcnavcolor=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'pcnavcolor'");
            if($pcnavcolor==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD pcnavcolor varchar(16) NOT NULL default '#24272c';");
            }
            $pcnavfontcolor=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'pcnavfontcolor'");
            if($pcnavfontcolor==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD pcnavfontcolor varchar(16) NOT NULL default '#3e3e3e';");
            }
            $pcnavfontscolor=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'pcnavfontscolor'");
            if($pcnavfontscolor==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD pcnavfontscolor varchar(16) NOT NULL default '#019e97';");
            }
            $pcthemecolor=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'pcthemecolor'");
            if($pcthemecolor==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD pcthemecolor varchar(16) NOT NULL default '#01b6ae';");
            }
            $pcbottomcolor=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'pcbottomcolor'");
            if($pcbottomcolor==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD pcbottomcolor varchar(16) NOT NULL default '#333333';");
            }
            $pcbottomfontcolor=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'pcbottomfontcolor'");
            if($pcbottomfontcolor==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD pcbottomfontcolor varchar(16) NOT NULL default '#cdcdcd';");
            }
            $platformtt_state=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'platformtt_state'");
            if($platformtt_state==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD platformtt_state tinyint(1) NOT NULL default 2;");
            }
            $search_state=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'search_state'");
            if($search_state==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD search_state tinyint(1) NOT NULL default 1;");
            }
            $bannerw=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'bannerw'");
            if($bannerw==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD bannerw int(5) NOT NULL default 750;");
            }
            $bannerh=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'bannerh'");
            if($bannerh==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD bannerh int(5) NOT NULL default 350;");
            }
            $inavs=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'inavs'");
            if($inavs==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD inavs int(5) NOT NULL default 84;");
            }
            $bnavh=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'bnavh'");
            if($bnavh==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD bnavh int(5) NOT NULL default 144;");
            }
            $bnavs=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'bnavs'");
            if($bnavs==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD bnavs int(5) NOT NULL default 50;");
            }
            $cemail_state=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'email_state'");
            if($cemail_state==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD email_state tinyint(1) NOT NULL DEFAULT 2;");
            }
            $cemail_self=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'email_self'");
            if($cemail_self==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD email_self varchar(32) NOT NULL;");
            }
            $cemail_code=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'email_code'");
            if($cemail_code==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD email_code varchar(64) NOT NULL;");
            }
            $expressfeestate=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'expressfeestate'");
            if($expressfeestate==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD expressfeestate tinyint(1) NOT NULL DEFAULT 1 COMMENT '1:免费；2收费';");
            }
            $expressfee=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'expressfee'");
            if($expressfee==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD expressfee decimal(7, 2) NOT NULL;");
            }
            $catelevel=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'catelevel'");
            if($catelevel==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD catelevel tinyint(1) NOT NULL DEFAULT 1;");
            }
            $freeexpressfee=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'freeexpressfee'");
            if($freeexpressfee==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD freeexpressfee decimal(7, 2) NOT NULL;");
            }
            $flagtitle=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'flagtitle'");
            if($flagtitle==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD flagtitle varchar(64) NOT NULL;");
            }
            $flags=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'flags'");
            if($flags==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD flags varchar(64) NOT NULL;");
            }
            $servershop=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'servershop'");
            if($servershop==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD servershop varchar(128) NOT NULL;");
            }
            $flagcontent=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_customer' AND column_name = 'flagcontent'");
            if($flagcontent==0){
                Db::execute("ALTER TABLE wdcmenterprise_customer ADD flagcontent text NOT NULL;");
            }
            //tmoduleset
            $e_title=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_tmoduleset' AND column_name = 'e_title'");
            if($e_title==0){
                Db::execute("ALTER TABLE wdcmenterprise_tmoduleset ADD e_title varchar(32) NOT NULL;");
            }
            //product
            $pseotitle=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_product' AND column_name = 'seotitle'");
            if($pseotitle==0){
                Db::execute("ALTER TABLE wdcmenterprise_product ADD seotitle varchar(100) NOT NULL;");
            }
            $pseokey=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_product' AND column_name = 'seokey'");
            if($pseokey==0){
                Db::execute("ALTER TABLE wdcmenterprise_product ADD seokey varchar(100) NOT NULL;");
            }
            $pseodes=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_product' AND column_name = 'seodes'");
            if($pseodes==0){
                Db::execute("ALTER TABLE wdcmenterprise_product ADD seodes text NOT NULL;");
            }
            //case
            $cseotitle=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_case' AND column_name = 'seotitle'");
            if($cseotitle==0){
                Db::execute("ALTER TABLE wdcmenterprise_case ADD seotitle varchar(100) NOT NULL;");
            }
            $cseokey=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_case' AND column_name = 'seokey'");
            if($cseokey==0){
                Db::execute("ALTER TABLE wdcmenterprise_case ADD seokey varchar(100) NOT NULL;");
            }
            $cseodes=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_case' AND column_name = 'seodes'");
            if($cseodes==0){
                Db::execute("ALTER TABLE wdcmenterprise_case ADD seodes text NOT NULL;");
            }
            //news
            $nseotitle=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_news' AND column_name = 'seotitle'");
            if($nseotitle==0){
                Db::execute("ALTER TABLE wdcmenterprise_news ADD seotitle varchar(100) NOT NULL;");
            }
            $nseokey=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_news' AND column_name = 'seokey'");
            if($nseokey==0){
                Db::execute("ALTER TABLE wdcmenterprise_news ADD seokey varchar(100) NOT NULL;");
            }
            $nseodes=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_news' AND column_name = 'seodes'");
            if($nseodes==0){
                Db::execute("ALTER TABLE wdcmenterprise_news ADD seodes text NOT NULL;");
            }
            //nav
            $single=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_nav' AND column_name = 'single'");
            if($single==0){
                Db::execute("ALTER TABLE wdcmenterprise_nav ADD single int(11) NOT NULL;");
            }
            $webpage=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_nav' AND column_name = 'webpage'");
            if($webpage==0){
                Db::execute("ALTER TABLE wdcmenterprise_nav ADD webpage varchar(100) NOT NULL;");
            }
            $telphone=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_nav' AND column_name = 'telphone'");
            if($telphone==0){
                Db::execute("ALTER TABLE wdcmenterprise_nav ADD telphone varchar(16) NOT NULL;");
            }
            $wxappid=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_nav' AND column_name = 'wxappid'");
            if($wxappid==0){
                Db::execute("ALTER TABLE wdcmenterprise_nav ADD wxappid varchar(32) NOT NULL;");
            }
            $wxpage=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_nav' AND column_name = 'wxpage'");
            if($wxpage==0){
                Db::execute("ALTER TABLE wdcmenterprise_nav ADD wxpage varchar(32) NOT NULL;");
            }
            $bdappid=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_nav' AND column_name = 'bdappid'");
            if($bdappid==0){
                Db::execute("ALTER TABLE wdcmenterprise_nav ADD bdappid varchar(32) NOT NULL;");
            }
            $bdpage=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_nav' AND column_name = 'bdpage'");
            if($bdpage==0){
                Db::execute("ALTER TABLE wdcmenterprise_nav ADD bdpage varchar(32) NOT NULL;");
            }
            $zjappid=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_nav' AND column_name = 'zjappid'");
            if($zjappid==0){
                Db::execute("ALTER TABLE wdcmenterprise_nav ADD zjappid varchar(32) NOT NULL;");
            }
            $zjpage=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_nav' AND column_name = 'zjpage'");
            if($zjpage==0){
                Db::execute("ALTER TABLE wdcmenterprise_nav ADD zjpage varchar(32) NOT NULL;");
            }
            //banner
            $link_style=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_banner' AND column_name = 'link_style'");
            if($link_style==0){
                Db::execute("ALTER TABLE wdcmenterprise_banner ADD link_style tinyint(1) NOT NULL;");
            }
            $bwebpage=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_banner' AND column_name = 'webpage'");
            if($bwebpage==0){
                Db::execute("ALTER TABLE wdcmenterprise_banner ADD webpage varchar(32) NOT NULL;");
            }
            $bwxappid=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_banner' AND column_name = 'wxappid'");
            if($bwxappid==0){
                Db::execute("ALTER TABLE wdcmenterprise_banner ADD wxappid varchar(32) NOT NULL;");
            }
            $bwxpage=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_banner' AND column_name = 'wxpage'");
            if($bwxpage==0){
                Db::execute("ALTER TABLE wdcmenterprise_banner ADD wxpage varchar(32) NOT NULL;");
            }
            $bbdappid=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_banner' AND column_name = 'bdappid'");
            if($bbdappid==0){
                Db::execute("ALTER TABLE wdcmenterprise_banner ADD bdappid varchar(32) NOT NULL;");
            }
            $bbdpage=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_banner' AND column_name = 'bdpage'");
            if($bbdpage==0){
                Db::execute("ALTER TABLE wdcmenterprise_banner ADD bdpage varchar(32) NOT NULL;");
            }
            $bzjappid=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_banner' AND column_name = 'zjappid'");
            if($bzjappid==0){
                Db::execute("ALTER TABLE wdcmenterprise_banner ADD zjappid varchar(32) NOT NULL;");
            }
            $bzjpage=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_banner' AND column_name = 'zjpage'");
            if($bzjpage==0){
                Db::execute("ALTER TABLE wdcmenterprise_banner ADD zjpage varchar(32) NOT NULL;");
            }
            //tableset
            $email_state=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_tableset' AND column_name = 'email_state'");
            if($email_state==0){
                Db::execute("ALTER TABLE wdcmenterprise_tableset ADD email_state tinyint(1) NOT NULL default 2;");
            }
            $email_self=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_tableset' AND column_name = 'email_self'");
            if($email_self==0){
                Db::execute("ALTER TABLE wdcmenterprise_tableset ADD email_self varchar(32) NOT NULL;");
            }
            $email_code=Db::execute("SELECT 1 FROM information_schema.columns WHERE table_schema='".config('database.database')."' AND table_name = 'wdcmenterprise_tableset' AND column_name = 'email_code'");
            if($email_code==0){
                Db::execute("ALTER TABLE wdcmenterprise_tableset ADD email_code varchar(64) NOT NULL;");
            }
            Db::execute("ALTER TABLE wdcmenterprise_shopcart engine =InnoDB;");
            $adminruleo=Db::name('adminruleo')->where('one','升级更新')->find();
            if(!$adminruleo){
                Db::name('adminruleo')->insert(['one'=>'升级更新']);
            }
            $pluginapp=Db::name('pluginapp')->where('title','商城')->find();
            if(!$pluginapp){
                Db::execute("INSERT INTO `wdcmenterprise_pluginapp` (`id`, `title`, `icon`, `state`, `buy_state`) VALUES
(1, '商城', '/static/img/plugin_shop.png', 1, 0);");
            }
            DB::name('system')->where('id',1)->update(['update_state'=>config('tmdversion')]);
            return json(['code' => 200,'msg' => '成功']);
        }
    }
}

